


use "${pathdata_robustness}/RobustnessExperiment5.dta", clear

** Treatments
// 1. Baseline 
// 2. StatPrompt
// 3. NoStory
// 4.  NoStoryPrompt



* ########## Regressions ##########



* ########## Effect of prompts: POOLED DATASET ############


drop prompt

preserve

	*Keep bot stats and stories
	keep if typestat!=. | typestory!=.
	
	gen prompt = 0
	replace prompt = 1 if typestat == 2 | typestory == 2

	keep prolific_pid product effect effect_recall prompt combined_recall

	rename effect dev0
	rename effect_recall dev1

	reshape long dev, i(prolific_pid product) j(delay) // Make the data long because we want to pool immediate and delay

	gen delayXprompt = 0
	replace delayXprompt = 1 if delay == 1 & prompt == 1

	*Column (1): All treatments - Belief Impact on indicators - LONG DATASET
	sum dev if prompt == 0 & delay == 0
	eststo reg1: reg dev delay prompt delayXprompt, cluster(prolific_pid)
	estadd scalar x = _b[_cons] // Here, we store the constant to put it into the footer :) 


	*Column (4): All treatments - combined recall on indicators - LONG DATASET
	eststo reg4: reg combined_recall prompt , cluster(prolific_pid) r
	estadd scalar x = _b[_cons]

restore


* ########## Effect of prompts: Baseline and StatPrompt ############


preserve 

	keep if typestat!=.

	*Keep only Stat no prompt and Stat prompt conditions!
	keep if inlist(treatment,1,2)

	gen prompt = 0
	replace prompt = 1 if typestat == 2

	keep prolific_pid product effect effect_recall prompt combined_recall

	rename effect dev0
	rename effect_recall dev1

	reshape long dev, i(prolific_pid product) j(delay) // Make the data long because we want to pool immediate and delay

	gen delayXprompt = 0
	replace delayXprompt = 1 if delay == 1 & prompt == 1

	*Column (2): Statistic target treatments only (treatment 1 and 2) - Belief Impact on indicators - LONG DATASET
	eststo reg2: reg dev delay prompt delayXprompt, cluster(prolific_pid)
	estadd scalar x = _b[_cons]


	*Column (5): Statistic target treatments only (treatment 1 and 2) - combined recall on indicators - LONG DATASET
	eststo reg5: reg combined_recall prompt , cluster(prolific_pid) r
	estadd scalar x = _b[_cons]


restore

* ########## Effect of prompts: NoStory and NoStory Prompt ############



preserve
 
keep if typestory!=.

	*Keep only Stat no prompt and Stat prompt conditions!
	keep if inlist(treatment,3,4)

	gen prompt = 0
	replace prompt = 1 if typestory == 2

	keep prolific_pid product effect effect_recall prompt combined_recall

	rename effect dev0
	rename effect_recall dev1

	reshape long dev, i(prolific_pid product) j(delay)

	gen delayXprompt = 0
	replace delayXprompt = 1 if delay == 1 & prompt == 1 // Make the data long because we want to pool immediate and delay

	*Column (3): NoStory target treatments only (treatment 3 and 4) - LONG DATASET
	eststo reg3: reg dev delay prompt delayXprompt, cluster(prolific_pid)
	estadd scalar x = _b[_cons]


	*Column (6): NoStory target treatments only (treatment 3 and 4) - combined recall on indicators - LONG DATASET
	eststo reg6: reg combined_recall prompt , cluster(prolific_pid) r
	estadd scalar x = _b[_cons]

restore



	
	esttab reg1 reg2 reg3 reg4 reg5 reg6 using "${pathout_robustness}/tables/tableA5.tex", ///
		booktabs nonotes replace compress label nomtitles star(* 0.10 ** 0.05 *** 0.01) ///
		keep(delay prompt delayXprompt) order(delay prompt delayXprompt) coeflabels( delay "Delay" prompt "Prompt" delayXprompt "Delay $/times$ Prompt") ///
		se(2) b(a2) stats(x N r2, fmt(2 0 2) label("Control Mean" "Observations" "R^2"))  ///
		prehead("{\begin{tabular}{l*{6}{c}}\toprule\toprule&\multicolumn{6}{c}{\textit{Dependent variable:}}//[.1cm] &\multicolumn{3}{c}{Belief Impact} &  \multicolumn{3}{c}{Combined Recall} //\cmidrule(lr){2-4} \cmidrule(lr){5-7} // \textit{Sample:} &\multicolumn{1}{c}{Pooled} &\multicolumn{1}{c}{Stat} &\multicolumn{1}{c}{NoStory} &\multicolumn{1}{c}{Pooled} &\multicolumn{1}{c}{Stat} &\multicolumn{1}{c}{NoStory} //")



